#include "LightTool.h"

#include <iostream>

using namespace Editor;

LightTool::LightTool(Editor::EditWidget* _widget): buttonPressed(false), widget(_widget)
{
}

void LightTool::leftButtonPressed()
{
  
  light = new QGraphicsPixmapItem(QPixmap("rond_jaune.png"));
  widget->scene()->addItem(light);
  widget->lights().push_back(Model::Light(mousePos.x(), mousePos.y()));
  
 
  light->setPos(mousePos.x(), mousePos.y());
  buttonPressed = true;
  
  emit sceneChanged();

}

void LightTool::leftButtonReleased()
{

  buttonPressed = false;
  
}


void LightTool::rightButtonPressed()
{

}

void LightTool::rightButtonReleased()
{

}

void LightTool::mouseMove(QPointF p)
{
    Tool::mouseMove(p);
}
